#include <QtGui/QApplication>
#include <QTextCodec>
#include "mainwindow.h"
#include "logindialog.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    /************************设置编码***************************/
    QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF8"));
    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF8"));
    QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF8"));
    LoginDialog dlg;    //声明登录界面类对象
    MainWindow w;       //声明聊天室类对象
    //设置信号槽机制
    QObject::connect(&dlg, SIGNAL(loginFinished(int, int, QString)), &w, SLOT(startup(int, int, QString)));
    dlg.show();         //显示登录界面

    return a.exec();
}
